#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
int fac1(int n)
{
	if (1 == n)
		return 1;
	return n * fac1(n - 1);
}
int fac2(int n)
{
	int ret=1;
	for (int i = 1; i <= n; i++)
	{
		ret = ret * i;
	}
	return ret;
}
int main()
{
	int n;
	scanf("%d", &n);
	printf("%d\n%d\n", fac1(n), fac2(n));
	return 0;
}